//
//  WBComposeMenuButton.swift
//  WeiBo
//
//  Created by chenguanglei on 16/12/4.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

class WBComposeMenuButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }
    
    
    private func setupUI(){
    
        titleLabel?.font = UIFont.systemFont(ofSize: 14)
        
        setTitleColor(UIColor.gray, for: .normal)
    
        titleLabel?.textAlignment = .center
        
        imageView?.contentMode = .center
    
    }
    
    
    override func layoutSubviews() {
        
        super.layoutSubviews()
        
        imageView?.frame = CGRect.init(x: 0, y: 0, width: self.bounds.size.width, height: self.bounds.size.width)
        
        titleLabel?.frame = CGRect.init(x: 0, y: self.bounds.size.width, width: self.bounds.size.width, height: self.bounds.size.height-self.bounds.size.width)
        
    }
    
    
}
